package com.xmkj.winmoney;

import android.view.View;
import android.widget.ImageView;

import com.common.mvp.BaseMvpActivity;
import com.common.mvp.BasePresenter;

import java.util.concurrent.TimeUnit;

import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;

/**
 * @desc: 启动页界面
 * @author: Leo
 * @date: 2016/12/23
 */
public class SplashActivity extends BaseMvpActivity {
    private ImageView ivSplash;


    @Override
    public int getLayoutId() {
        return R.layout.activity_splash;
    }

    @Override
    protected void onViewCreated() {

    }

    @Override
    protected void setNavigation() {
        super.setNavigation();
        m_statusBar.setVisibility(View.GONE);
    }

    @Override
    protected BasePresenter createPresenterInstance() {
        return null;
    }


    @Override
    protected void doLogicFunc() {
        Observable.timer(1000, TimeUnit.MILLISECONDS)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Action1<Long>() {
                    @Override
                    public void call(Long aLong) {
                    /*    if(EmptyUtils.isNotEmpty(SPUtils.getShareString(Constans.HASHID))){
                            gotoActivity(MainWinActivity.class);
                        }else {
                            gotoActivity(LoginActivtiy.class);
                        }*/
                        gotoActivity(MainWinActivity.class);
                    /*    SPUtils.setShareInt(Constans.UID, 18);
                        SPUtils.setShareString(Constans.HASHID, "50ba90200c801afdb0070ee0017099bc");
                        SPUtils.setShareString(Constans.HX_USERNAME,"42291087ba335b21b7757ef4857a1330");
                        SPUtils.setShareString(Constans.HX_PASSWORD,"f6bb62dfb53adc087c00d1bd599275fb");
                        gotoActivity(MainWinActivity.class);*/
//                        gotoActivity(LoginActivtiy.class);

                        finish();
                    }
                });
    }

}